



			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	
*-------------------------------------------------------------------------------
* E4a
*-------------------------------------------------------------------------------

* data
use "data/inputs/MunicipioData_AD_Chavez.dta", clear

* save correlation with AD 1958
mat results = J(11, 2, 0)
local i = 1
foreach year of numlist 1963(5)1998 2000(6)2012 {
	cap cor share_presAD1958 share_presAD`year'
	if _rc == 0 {
	mat results[`i',1] = `year'
	mat results[`i',2] = `r(rho)'
	}
	else {
	cor share_presAD1958 share_presOFIC`year'
	mat results[`i',1] = `year'
	mat results[`i',2] = `r(rho)'
	}
	local i = `i' + 1
}

* use results
clear 
svmat results
rename results1 year
rename results2 cor1958

* Figure E4A
#delimit;
twoway (connected cor1958 year if year > 1958, 
	    lcolor(white) mcolor(white) 
	    mlwidth(thick) mlcolor(white) msize(large))
		
	   (connected cor1958 year if year >= 1963 & year <= 2012, 
	    lcolor(black) mcolor(black) lwidth(medthick)
	    mlwidth(thick) mlcolor(white) msize(large))
		
	   (scatter cor1958 year if year == 1963, 
	    mcolor(black) 
	    mlwidth(thick) mlcolor(white) msize(large))
		
	   (scatter cor1958 year if year >= 1998 & year <= 2012, 
	    lcolor(black) mcolor(black) lwidth(medthick) msymbol(diamond)
	    mlwidth(thick) mlcolor(white) msize(large))
		
   	   (scatter cor1958 year if year == 1998, 
	    lcolor(black) mcolor(blue) msymbol(diamond)
	    mlwidth(thick) mlcolor(white) msize(large)),

		yline(0, lwidth(thick) lcolor(gs12))
		graphregion(fcolor(white) lcolor(white) margin(zero))
        plotregion(fcolor(white) lstyle(none) lcolor(white) ilstyle(none))
		xsize(7) ysize(5)	
		title("", size(large))
		ytitle("Correlation with 1958 AD vote share", color(black) size(large))
		xtitle("")
		yscale()
		ylabel(-.2(.2)1, labsize(large) glcolor(white) angle(horizontal))
		xlabel(1958 "1958"
		1968 "1968"
		1978 "1978"
		1988 "1988"
		1998 "98  "
		2000 "  00"
		2006 "2006"
		2012 "2012", labsize(large))
		xscale( range(1958 2014))
        legend(order(3 "AD vs. AD 1958" 4 "Chávez vs. AD 1958") pos(8) ring(0) rows(2) 		  region(lcolor(white)));
graph export "figures/FigureE4a.pdf", replace;
#delimit cr

	



			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	
*-------------------------------------------------------------------------------
* E4b
*-------------------------------------------------------------------------------


* data
use "data/inputs/MunicipioData_AD_Chavez.dta", clear


* collapse to state level
* Note: this is approximate
drop ln_density*
reshape long share_presAD share_presOFIC pob_cgr, i(estado municipio) j(year)
collapse (mean) share_pres* [fw=pob_cgr], by(estado year)
reshape wide share_presAD share_presOFIC, i(estado) j(year)
missings dropvars


* save correlation with AD 1958
mat results = J(11, 2, 0)
local i = 1
foreach year of numlist 1963(5)1998 2000(6)2012 {
	cap cor share_presAD1958 share_presAD`year'
	if _rc == 0 {
	mat results[`i',1] = `year'
	mat results[`i',2] = `r(rho)'
	}
	else {
	cor share_presAD1958 share_presOFIC`year'
	mat results[`i',1] = `year'
	mat results[`i',2] = `r(rho)'
	}
	local i = `i' + 1
}

* use results
clear 
svmat results
rename results1 year
rename results2 cor1958

* Figure E4A
#delimit;
twoway (connected cor1958 year if year > 1958, 
	    lcolor(white) mcolor(white) 
	    mlwidth(thick) mlcolor(white) msize(large))
		
	   (connected cor1958 year if year >= 1963 & year <= 2012, 
	    lcolor(black) mcolor(black) lwidth(medthick)
	    mlwidth(thick) mlcolor(white) msize(large))
		
	   (scatter cor1958 year if year == 1963, 
	    mcolor(black) 
	    mlwidth(thick) mlcolor(white) msize(large))
		
	   (scatter cor1958 year if year >= 1998 & year <= 2012, 
	    lcolor(black) mcolor(black) lwidth(medthick) msymbol(diamond)
	    mlwidth(thick) mlcolor(white) msize(large))
		
   	   (scatter cor1958 year if year == 1998, 
	    lcolor(black) mcolor(blue) msymbol(diamond)
	    mlwidth(thick) mlcolor(white) msize(large)),

		yline(0, lwidth(thick) lcolor(gs12))
		graphregion(fcolor(white) lcolor(white) margin(zero))
        plotregion(fcolor(white) lstyle(none) lcolor(white) ilstyle(none))
		xsize(7) ysize(5)	
		title("", size(large))
		ytitle("Correlation with 1958 AD vote share", color(black) size(large))
		xtitle("")
		yscale()
		ylabel(-.2(.2)1, labsize(large) glcolor(white) angle(horizontal))
		xlabel(1958 "1958"
		1968 "1968"
		1978 "1978"
		1988 "1988"
		1998 "98  "
		2000 "  00"
		2006 "2006"
		2012 "2012", labsize(large))
		xscale( range(1958 2014))
        legend(order(3 "AD vs. AD 1958" 4 "Chávez vs. AD 1958") pos(8) ring(0) rows(2) 		  region(lcolor(white)));
graph export "figures/FigureE4b.pdf", replace;
#delimit cr
	



			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
			**	**	**	**	**	**	**	**	**	**	**	**	**
	
*-------------------------------------------------------------------------------
* E4c–g
*-------------------------------------------------------------------------------


* data
use "data/inputs/MunicipioData_AD_Chavez.dta", clear
 
 
* AD correlations
local year = 1963
foreach letter in c d e f g h i {


* graph
#delimit;
twoway (scatter share_presAD`year' share_presAD1958, 
        msize(small) mcolor(gs10))
     
	   (lfit  share_presAD`year' share_presAD1958, 
	    lcolor(black) lpattern(dash)),
		
		graphregion(fcolor(white) lcolor(white) margin(zero))
        plotregion(fcolor(white) lstyle(none) lcolor(white) ilstyle(none))
        xsize(8) ysize(5)
		title("", size(large))
		ytitle("`year' AD Vote Share", color(black) size(large))
		xtitle("1958 AD Vote Share", size(large))
        yscale()
		ylabel(0(.2).8, labsize(large) glcolor(white) angle(horizontal))
		xlabel(0(.2)1, labsize(large))
		xscale()
        legend(off);
		graph export "figures/FigureE4`letter'.pdf", replace;
#delimit cr

local year = `year' + 5
}


* Chávez correlations
local year = 1998
foreach letter in j k l m {
	
* graph
#delimit;
twoway (scatter share_presOFIC`year' share_presAD1958, 
        msize(small) mcolor(gs10))
     
	   (lfit  share_presOFIC`year' share_presAD1958, 
	    lcolor(black) lpattern(dash)),
		
		graphregion(fcolor(white) lcolor(white) margin(zero))
        plotregion(fcolor(white) lstyle(none) lcolor(white) ilstyle(none))
        xsize(8) ysize(5)
		title("", size(large))
		ytitle("`year' Chávez Vote Share", color(black) size(large))
		xtitle("1958 AD Vote Share", size(large))
        yscale()
		ylabel(0(.2).8, labsize(large) glcolor(white) angle(horizontal))
		xlabel(0(.2)1, labsize(large))
		xscale()
        legend(off);
		graph export "figures/FigureE4`letter'.pdf", replace;
#delimit cr

if `year' == 1998 {
	local year = `year' + 2
	}
else {
	local year = `year' + 6
	}

	
}


* End
